<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>添加供应商</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../component/elementUI/index.css">
    <link rel="stylesheet" href="../../../style/wangeditor.css">
    <link rel="stylesheet" href="../../../style/index.css">
    <style>
        .el-descriptions-item__label {
            width: 100px;
        }
        .el-dialog__body{
            padding: 0 20px 0px;
        }
        .el-cascader__search-input{
            display: none;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak>
        <yl-page-header content="添加供应商"></yl-page-header>
        <el-form :model="form" :rules="rules" ref="contract" inline-message="true" style="width: 100%">
            <div class="table_titel">
                <div class="titel">添加供应商</div>
            </div>
            <el-descriptions :column="2" border size="small">
                <el-descriptions-item label="供应商名称">
                    <el-form-item prop="Supplier_Name">
                        <el-input v-model.trim="form.Supplier_Name" placeholder="请输入供应商名称"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="纳税识别号">
                    <el-form-item prop="Tax_Number">
                        <el-input v-model.trim="form.Tax_Number" placeholder="请输入纳税识别号"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="地址">
                    <el-form-item prop="Supplier_Address">
                        <el-cascader v-model="value" filterable :props="{value:'label'}" :options="city" style="width: 100%"></el-cascader>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="详细地址">
                    <el-form-item prop="address">
                      <el-input :disabled="value.length < 3" v-model.trim="form.address"  placeholder="请输入详细地址">
                    </el-form-item>
                  </el-descriptions-item>
            </el-descriptions>
            <div class="table_titel">
                <div class="titel">供应商品</div>
                <div class="operation">
                    <el-button @click="dialogVisible = true" type="primary" size="small">选择商品</el-button>
                </div>
            </div>
            <template v-if="business_supplier_article.length>0">
                <el-table :data="business_supplier_article.slice((page.page-1)*page.limit,page.page*page.limit)" stripe border  height="55vh"  style="width: 100%">
                    <el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
                    <el-table-column prop="Article_Name"  align="center" label="商品名称"></el-table-column>
                    <el-table-column prop="Specifications_Name"  align="center" label="规格名称"></el-table-column>
                    <el-table-column prop="Picture_URL"  align="center" label="图片">
                        <template v-slot="{row}">
                            <el-image fit="contain" :src="BASE_IMG + row.Picture_URL" style="width:100px; height:100px;"></el-image>
                        </template>
                    </el-table-column>
                    <el-table-column align="center" label="操作">
                        <template v-slot="{row,$index}">
                            <el-button type="danger" size="small" @click="handleRemove($index)">删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
                    :current-page="page.page" :page-sizes="[10 ,100, 200, 300, 400]" :page-size="page.limit"
                    layout="total, sizes, prev, pager, next, jumper" :total="business_supplier_article.length">
                </el-pagination>
            </template> 
            <div class="table_titel">
                <div class="titel">银行账号</div>
                <div class="operation">
                    <el-button @click="add_supplier_bank_account" type="primary" size="small">新增</el-button>
                    <el-button @click="remove_supplier_bank_account" type="danger" size="small">删除</el-button>
                </div>
            </div>
            <el-descriptions :column="2" border size="small" v-for="(item,index) in form.Children.business_supplier_bank_account" :key="index">
                <el-descriptions-item :label="index + 1 +'.开户银行'">
                    <el-form-item prop="Bank_Name">
                        <el-input v-model.trim="item.Bank_Name" placeholder="请选择开户银行"></el-input>
                    </el-form-item>
                </el-descriptions-item>
                <el-descriptions-item label="银行账号">
                    <el-form-item prop="Account_Number">
                        <el-input v-model.trim="item.Account_Number" placeholder="请选择银行账号"></el-input>
                    </el-form-item>
                </el-descriptions-item>
            </el-descriptions>
            <div style="height: 90px;"></div>
            <el-form-item class="form-operation">
                <el-button @click="window.history.back()">返回</el-button>
                <el-button type="primary" :loading="loading" @click="submitForm('contract')">提交</el-button>
            </el-form-item>
        </el-form>
        <yl-goods :visible.sync="dialogVisible" @success="getArticle"></yl-goods>
    </div>
    <script type="text/javascript" src="../../../utils/wangeditor.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.min.js"></script>
    <script type="text/javascript" src="../../../utils/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../utils/vue.min.js"></script>
    <script type="text/javascript" src="../../../utils/vuex.min.js"></script>
    <script type="text/javascript" src="../../../component/elementUI/index.js"></script>
    <script type="text/javascript" src="../../../component/component.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.full.min.js"></script>
    <script type="text/javascript" src="../../../utils/xlsx.core.min.js"></script>
    <script type="text/javascript" src="../../../config/config.js"></script>
    <script type="text/javascript" src="../../../utils/base64.js"></script>
    <script type="text/javascript" src="../../../utils/compressor.js"></script>
    <script type="text/javascript" src="../../../utils/ID_Validity.js"></script>
    <script type="text/javascript" src="../../../utils/utils.js"></script>
    <script type="text/javascript" src="js/add.js"></script>
</body>

</html>